import { ref, unref, watch, onMounted } from 'vue'
import { getSelection, batchUpdateValue,fireExecute } from '/src/utils/index'
export function init(self) {
  const module = self.module.value
  self.custom = {
    columns : [
      {
        prop: 'workspace_name',
        order: 'asc',
        width: 150,
      },
      {
        prop: 'name',
        order: 'asc',
        width: 300,
      },
      {
        prop: 'value',
        width: 400,
      }
    ],

    editColumns : [
      {
        prop: 'workspace_name',
        label: '工作区',
        list_remote: {
          module: 'sdp_workspace', method:'list',
          query: {},
          sortInfo: ['name'],
          mapInfo: {label:'name', value:'name'}
        },
        type: 'select',
        required: true,
        onchange: param => {
          let {mode, form, column, columns, get_remote_list, set_query_storage} = param
          if (mode.indexOf('init') < 0) {
          }
        },
      },
      {
        prop: 'name',
        required: true,
      },
    ],

    queryColumns : [
      {
        prop: 'workspace_name',
        fixed: true,
        list_remote: {
          module: 'sdp_workspace', method:'list',
          query: {},
          sortInfo: ['name'],
          mapInfo: {label:'name', value:'name'}
        },
        type: 'select',
      },
      {
        prop: 'name_like',
        label: '名称',
        width: '150px',
      },
      {
        prop: 'value_like',
        label: '值',
        width: '150px',
      },
    ],

    buttons: [
      {
        prop: 'fireExecute',
        label: '生成文件',
        type: 'success',
        loading: false,
        onclick: (param) => {
          fireExecute({param, self})
        }
      },
    ],

    remoteConfig : {
    },

    onInit: () => {
    },
  }
}

